import pinia from "@/stores";
import i18n from "@/local";
import ArcoVue from '@arco-design/web-vue';
import ArcoVueIcon from '@arco-design/web-vue/es/icon';
import directive from "@/directives";
import router from "@/router";

export default {
    install(app: any) {
        // 国际化
        app.use(i18n)
        // 状态管理
        app.use(pinia)
        // UI
        app.use(ArcoVue)
        // 图标
        app.use(ArcoVueIcon)
        // 自定义指令
        directive(app)
        // 路由
        app.use(router)
        // 动态导入组件
        const modules = import.meta.glob('@/components/framework/**/**.vue')
        // 注册组件
        for (const path in modules) {
            modules[path]().then((mod: any) => {
                const component = mod.default;
                app.component(component.__name, component);
            } )
        }

    }
}